Only 20min timelapse because we concluded that we wont be able to decouple photobleaching from proteasomal decay

this RMD is to generate the df for decay rate estimation for the DMSO control

library(data.table)
library(tidyverse)
library(reshape2)
library(gganimate)
library(ggridges)
library(ggpubr)
source("~/R-scripts/R_functions/master-2-3-22.R")

#getting the information for imaris files ##files to read from Imaris

FilesToRead <- c("C0_Area", 
            "C0_Ellipsoid_Axis_Length_B",
            "C0_Ellipsoid_Axis_Length_C",
            "C0_Intensity_Center_Ch=3",
            "C0_Intensity_Mean_Ch=3", 
            "C0_Intensity_Median_Ch=3",
            "C0_Intensity_Sum_Ch=3",
            "C0_Number_of_Voxels", 
            "C0_Number_of_Triangles",
            "C0_Sphericity", 
            "C0_Volume.csv", 
            "C0_Position.csv" )

##actual reading and making them into df

####MG132
#Getting the list of all the samples in the experiment 
gfp_imaris <- dir("~/Imaris-data/2022/pup1_rfp/10-7-22/cln2/imaris/gfp", full.names = TRUE)

#getting the information for imageJ image info files
#getting all the image info txt for all the images in the experiment. 
list.image.info <- list.files("~/Imaris-data/2022/pup1_rfp/10-7-22/cln2/image_info_imageJ" , full.names = TRUE)

#Extracting information from the imageJ csv into a df with actual time differences between each images 
real.time.interval.df <- get.image.info.OnlyGFP(list.image.info = list.image.info)      
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names,  :
  Item 1 has 0 rows but longest item has 1; filled with NA
#Extracting information from the imaris csv into a df with information on area, time, gfp intensity, mcherry intensity, (mean, median and sum), volume, trackID and IDs
list.of.files.gfp <- get.imaris.info.onlyGFP( dir.names = gfp_imaris, 
                                              files_to_read = FilesToRead ,
                                              real.time.interval.df = real.time.interval.df)
Warning in stri_split_regex(string, pattern, n = n, simplify = simplify,  :
  argument is not an atomic vector; coercing
New names:
• `Unit` -> `Unit...2`
• `Time` -> `Time...3`
• `TrackID` -> `TrackID...4`
• `ID` -> `ID...5`
• `X` -> `X...6`
• `Unit` -> `Unit...8`
• `Time` -> `Time...9`
• `TrackID` -> `TrackID...10`
• `ID` -> `ID...11`
• `X` -> `X...12`
• `Unit` -> `Unit...14`
• `Time` -> `Time...15`
• `TrackID` -> `TrackID...16`
• `ID` -> `ID...17`
• `X` -> `X...18`
• `Unit` -> `Unit...20`
• `Channel` -> `Channel...21`
• `Time` -> `Time...22`
• `TrackID` -> `TrackID...23`
• `ID` -> `ID...24`
• `X` -> `X...25`
• `Unit` -> `Unit...27`
• `Channel` -> `Channel...28`
• `Time` -> `Time...29`
• `TrackID` -> `TrackID...30`
• `ID` -> `ID...31`
• `X` -> `X...32`
• `Unit` -> `Unit...34`
• `Channel` -> `Channel...35`
• `Time` -> `Time...36`
• `TrackID` -> `TrackID...37`
• `ID` -> `ID...38`
• `X` -> `X...39`
• `Unit` -> `Unit...41`
• `Channel` -> `Channel...42`
• `Time` -> `Time...43`
• `TrackID` -> `TrackID...44`
• `ID` -> `ID...45`
• `X` -> `X...46`
• `Unit` -> `Unit...48`
• `Time` -> `Time...49`
• `TrackID` -> `TrackID...50`
• `ID` -> `ID...51`
• `X` -> `X...52`
• `Unit` -> `Unit...54`
• `Time` -> `Time...55`
• `TrackID` -> `TrackID...56`
• `ID` -> `ID...57`
• `X` -> `X...58`
• `Unit` -> `Unit...60`
• `Time` -> `Time...61`
• `TrackID` -> `TrackID...62`
• `ID` -> `ID...63`
• `X` -> `X...64`
• `Unit` -> `Unit...66`
• `Time` -> `Time...67`
• `TrackID` -> `TrackID...68`
• `ID` -> `ID...69`
• `X` -> `X...70`
• `Unit` -> `Unit...74`
• `Time` -> `Time...76`
• `TrackID` -> `TrackID...77`
• `ID` -> `ID...78`
• `X` -> `X...79`
Warning: Problem while computing `experiment = ...[]`.
ℹ argument is not an atomic vector; coercing
Warning: Problem while computing `sample = ...[]`.
ℹ argument is not an atomic vector; coercing
Warning in stri_split_regex(string, pattern, n = n, simplify = simplify,  :
  argument is not an atomic vector; coercing
New names:
• `Unit` -> `Unit...2`
• `Time` -> `Time...3`
• `TrackID` -> `TrackID...4`
• `ID` -> `ID...5`
• `X` -> `X...6`
• `Unit` -> `Unit...8`
• `Time` -> `Time...9`
• `TrackID` -> `TrackID...10`
• `ID` -> `ID...11`
• `X` -> `X...12`
• `Unit` -> `Unit...14`
• `Time` -> `Time...15`
• `TrackID` -> `TrackID...16`
• `ID` -> `ID...17`
• `X` -> `X...18`
• `Unit` -> `Unit...20`
• `Channel` -> `Channel...21`
• `Time` -> `Time...22`
• `TrackID` -> `TrackID...23`
• `ID` -> `ID...24`
• `X` -> `X...25`
• `Unit` -> `Unit...27`
• `Channel` -> `Channel...28`
• `Time` -> `Time...29`
• `TrackID` -> `TrackID...30`
• `ID` -> `ID...31`
• `X` -> `X...32`
• `Unit` -> `Unit...34`
• `Channel` -> `Channel...35`
• `Time` -> `Time...36`
• `TrackID` -> `TrackID...37`
• `ID` -> `ID...38`
• `X` -> `X...39`
• `Unit` -> `Unit...41`
• `Channel` -> `Channel...42`
• `Time` -> `Time...43`
• `TrackID` -> `TrackID...44`
• `ID` -> `ID...45`
• `X` -> `X...46`
• `Unit` -> `Unit...48`
• `Time` -> `Time...49`
• `TrackID` -> `TrackID...50`
• `ID` -> `ID...51`
• `X` -> `X...52`
• `Unit` -> `Unit...54`
• `Time` -> `Time...55`
• `TrackID` -> `TrackID...56`
• `ID` -> `ID...57`
• `X` -> `X...58`
• `Unit` -> `Unit...60`
• `Time` -> `Time...61`
• `TrackID` -> `TrackID...62`
• `ID` -> `ID...63`
• `X` -> `X...64`
• `Unit` -> `Unit...66`
• `Time` -> `Time...67`
• `TrackID` -> `TrackID...68`
• `ID` -> `ID...69`
• `X` -> `X...70`
• `Unit` -> `Unit...74`
• `Time` -> `Time...76`
• `TrackID` -> `TrackID...77`
• `ID` -> `ID...78`
• `X` -> `X...79`
Warning: Problem while computing `experiment = ...[]`.
ℹ argument is not an atomic vector; coercing
Warning: Problem while computing `sample = ...[]`.
ℹ argument is not an atomic vector; coercing
Warning in stri_split_regex(string, pattern, n = n, simplify = simplify,  :
  argument is not an atomic vector; coercing
New names:
• `Unit` -> `Unit...2`
• `Time` -> `Time...3`
• `TrackID` -> `TrackID...4`
• `ID` -> `ID...5`
• `X` -> `X...6`
• `Unit` -> `Unit...8`
• `Time` -> `Time...9`
• `TrackID` -> `TrackID...10`
• `ID` -> `ID...11`
• `X` -> `X...12`
• `Unit` -> `Unit...14`
• `Time` -> `Time...15`
• `TrackID` -> `TrackID...16`
• `ID` -> `ID...17`
• `X` -> `X...18`
• `Unit` -> `Unit...20`
• `Channel` -> `Channel...21`
• `Time` -> `Time...22`
• `TrackID` -> `TrackID...23`
• `ID` -> `ID...24`
• `X` -> `X...25`
• `Unit` -> `Unit...27`
• `Channel` -> `Channel...28`
• `Time` -> `Time...29`
• `TrackID` -> `TrackID...30`
• `ID` -> `ID...31`
• `X` -> `X...32`
• `Unit` -> `Unit...34`
• `Channel` -> `Channel...35`
• `Time` -> `Time...36`
• `TrackID` -> `TrackID...37`
• `ID` -> `ID...38`
• `X` -> `X...39`
• `Unit` -> `Unit...41`
• `Channel` -> `Channel...42`
• `Time` -> `Time...43`
• `TrackID` -> `TrackID...44`
• `ID` -> `ID...45`
• `X` -> `X...46`
• `Unit` -> `Unit...48`
• `Time` -> `Time...49`
• `TrackID` -> `TrackID...50`
• `ID` -> `ID...51`
• `X` -> `X...52`
• `Unit` -> `Unit...54`
• `Time` -> `Time...55`
• `TrackID` -> `TrackID...56`
• `ID` -> `ID...57`
• `X` -> `X...58`
• `Unit` -> `Unit...60`
• `Time` -> `Time...61`
• `TrackID` -> `TrackID...62`
• `ID` -> `ID...63`
• `X` -> `X...64`
• `Unit` -> `Unit...66`
• `Time` -> `Time...67`
• `TrackID` -> `TrackID...68`
• `ID` -> `ID...69`
• `X` -> `X...70`
• `Unit` -> `Unit...74`
• `Time` -> `Time...76`
• `TrackID` -> `TrackID...77`
• `ID` -> `ID...78`
• `X` -> `X...79`
Warning: Problem while computing `experiment = ...[]`.
ℹ argument is not an atomic vector; coercing
Warning: Problem while computing `sample = ...[]`.
ℹ argument is not an atomic vector; coercing
Warning in stri_split_regex(string, pattern, n = n, simplify = simplify,  :
  argument is not an atomic vector; coercing
New names:
• `Unit` -> `Unit...2`
• `Time` -> `Time...3`
• `TrackID` -> `TrackID...4`
• `ID` -> `ID...5`
• `X` -> `X...6`
• `Unit` -> `Unit...8`
• `Time` -> `Time...9`
• `TrackID` -> `TrackID...10`
• `ID` -> `ID...11`
• `X` -> `X...12`
• `Unit` -> `Unit...14`
• `Time` -> `Time...15`
• `TrackID` -> `TrackID...16`
• `ID` -> `ID...17`
• `X` -> `X...18`
• `Unit` -> `Unit...20`
• `Channel` -> `Channel...21`
• `Time` -> `Time...22`
• `TrackID` -> `TrackID...23`
• `ID` -> `ID...24`
• `X` -> `X...25`
• `Unit` -> `Unit...27`
• `Channel` -> `Channel...28`
• `Time` -> `Time...29`
• `TrackID` -> `TrackID...30`
• `ID` -> `ID...31`
• `X` -> `X...32`
• `Unit` -> `Unit...34`
• `Channel` -> `Channel...35`
• `Time` -> `Time...36`
• `TrackID` -> `TrackID...37`
• `ID` -> `ID...38`
• `X` -> `X...39`
• `Unit` -> `Unit...41`
• `Channel` -> `Channel...42`
• `Time` -> `Time...43`
• `TrackID` -> `TrackID...44`
• `ID` -> `ID...45`
• `X` -> `X...46`
• `Unit` -> `Unit...48`
• `Time` -> `Time...49`
• `TrackID` -> `TrackID...50`
• `ID` -> `ID...51`
• `X` -> `X...52`
• `Unit` -> `Unit...54`
• `Time` -> `Time...55`
• `TrackID` -> `TrackID...56`
• `ID` -> `ID...57`
• `X` -> `X...58`
• `Unit` -> `Unit...60`
• `Time` -> `Time...61`
• `TrackID` -> `TrackID...62`
• `ID` -> `ID...63`
• `X` -> `X...64`
• `Unit` -> `Unit...66`
• `Time` -> `Time...67`
• `TrackID` -> `TrackID...68`
• `ID` -> `ID...69`
• `X` -> `X...70`
• `Unit` -> `Unit...74`
• `Time` -> `Time...76`
• `TrackID` -> `TrackID...77`
• `ID` -> `ID...78`
• `X` -> `X...79`
Warning: Problem while computing `experiment = ...[]`.
ℹ argument is not an atomic vector; coercing
Warning: Problem while computing `sample = ...[]`.
ℹ argument is not an atomic vector; coercing
Warning in stri_split_regex(string, pattern, n = n, simplify = simplify,  :
  argument is not an atomic vector; coercing
New names:
• `Unit` -> `Unit...2`
• `Time` -> `Time...3`
• `TrackID` -> `TrackID...4`
• `ID` -> `ID...5`
• `X` -> `X...6`
• `Unit` -> `Unit...8`
• `Time` -> `Time...9`
• `TrackID` -> `TrackID...10`
• `ID` -> `ID...11`
• `X` -> `X...12`
• `Unit` -> `Unit...14`
• `Time` -> `Time...15`
• `TrackID` -> `TrackID...16`
• `ID` -> `ID...17`
• `X` -> `X...18`
• `Unit` -> `Unit...20`
• `Channel` -> `Channel...21`
• `Time` -> `Time...22`
• `TrackID` -> `TrackID...23`
• `ID` -> `ID...24`
• `X` -> `X...25`
• `Unit` -> `Unit...27`
• `Channel` -> `Channel...28`
• `Time` -> `Time...29`
• `TrackID` -> `TrackID...30`
• `ID` -> `ID...31`
• `X` -> `X...32`
• `Unit` -> `Unit...34`
• `Channel` -> `Channel...35`
• `Time` -> `Time...36`
• `TrackID` -> `TrackID...37`
• `ID` -> `ID...38`
• `X` -> `X...39`
• `Unit` -> `Unit...41`
• `Channel` -> `Channel...42`
• `Time` -> `Time...43`
• `TrackID` -> `TrackID...44`
• `ID` -> `ID...45`
• `X` -> `X...46`
• `Unit` -> `Unit...48`
• `Time` -> `Time...49`
• `TrackID` -> `TrackID...50`
• `ID` -> `ID...51`
• `X` -> `X...52`
• `Unit` -> `Unit...54`
• `Time` -> `Time...55`
• `TrackID` -> `TrackID...56`
• `ID` -> `ID...57`
• `X` -> `X...58`
• `Unit` -> `Unit...60`
• `Time` -> `Time...61`
• `TrackID` -> `TrackID...62`
• `ID` -> `ID...63`
• `X` -> `X...64`
• `Unit` -> `Unit...66`
• `Time` -> `Time...67`
• `TrackID` -> `TrackID...68`
• `ID` -> `ID...69`
• `X` -> `X...70`
• `Unit` -> `Unit...74`
• `Time` -> `Time...76`
• `TrackID` -> `TrackID...77`
• `ID` -> `ID...78`
• `X` -> `X...79`
Warning: Problem while computing `experiment = ...[]`.
ℹ argument is not an atomic vector; coercing
Warning: Problem while computing `sample = ...[]`.
ℹ argument is not an atomic vector; coercing
Warning in stri_split_regex(string, pattern, n = n, simplify = simplify,  :
  argument is not an atomic vector; coercing
New names:
• `Unit` -> `Unit...2`
• `Time` -> `Time...3`
• `TrackID` -> `TrackID...4`
• `ID` -> `ID...5`
• `X` -> `X...6`
• `Unit` -> `Unit...8`
• `Time` -> `Time...9`
• `TrackID` -> `TrackID...10`
• `ID` -> `ID...11`
• `X` -> `X...12`
• `Unit` -> `Unit...14`
• `Time` -> `Time...15`
• `TrackID` -> `TrackID...16`
• `ID` -> `ID...17`
• `X` -> `X...18`
• `Unit` -> `Unit...20`
• `Channel` -> `Channel...21`
• `Time` -> `Time...22`
• `TrackID` -> `TrackID...23`
• `ID` -> `ID...24`
• `X` -> `X...25`
• `Unit` -> `Unit...27`
• `Channel` -> `Channel...28`
• `Time` -> `Time...29`
• `TrackID` -> `TrackID...30`
• `ID` -> `ID...31`
• `X` -> `X...32`
• `Unit` -> `Unit...34`
• `Channel` -> `Channel...35`
• `Time` -> `Time...36`
• `TrackID` -> `TrackID...37`
• `ID` -> `ID...38`
• `X` -> `X...39`
• `Unit` -> `Unit...41`
• `Channel` -> `Channel...42`
• `Time` -> `Time...43`
• `TrackID` -> `TrackID...44`
• `ID` -> `ID...45`
• `X` -> `X...46`
• `Unit` -> `Unit...48`
• `Time` -> `Time...49`
• `TrackID` -> `TrackID...50`
• `ID` -> `ID...51`
• `X` -> `X...52`
• `Unit` -> `Unit...54`
• `Time` -> `Time...55`
• `TrackID` -> `TrackID...56`
• `ID` -> `ID...57`
• `X` -> `X...58`
• `Unit` -> `Unit...60`
• `Time` -> `Time...61`
• `TrackID` -> `TrackID...62`
• `ID` -> `ID...63`
• `X` -> `X...64`
• `Unit` -> `Unit...66`
• `Time` -> `Time...67`
• `TrackID` -> `TrackID...68`
• `ID` -> `ID...69`
• `X` -> `X...70`
• `Unit` -> `Unit...74`
• `Time` -> `Time...76`
• `TrackID` -> `TrackID...77`
• `ID` -> `ID...78`
• `X` -> `X...79`
Warning: Problem while computing `experiment = ...[]`.
ℹ argument is not an atomic vector; coercing
Warning: Problem while computing `sample = ...[]`.
ℹ argument is not an atomic vector; coercing
Warning in stri_split_regex(string, pattern, n = n, simplify = simplify,  :
  argument is not an atomic vector; coercing
New names:
• `Unit` -> `Unit...2`
• `Time` -> `Time...3`
• `TrackID` -> `TrackID...4`
• `ID` -> `ID...5`
• `X` -> `X...6`
• `Unit` -> `Unit...8`
• `Time` -> `Time...9`
• `TrackID` -> `TrackID...10`
• `ID` -> `ID...11`
• `X` -> `X...12`
• `Unit` -> `Unit...14`
• `Time` -> `Time...15`
• `TrackID` -> `TrackID...16`
• `ID` -> `ID...17`
• `X` -> `X...18`
• `Unit` -> `Unit...20`
• `Channel` -> `Channel...21`
• `Time` -> `Time...22`
• `TrackID` -> `TrackID...23`
• `ID` -> `ID...24`
• `X` -> `X...25`
• `Unit` -> `Unit...27`
• `Channel` -> `Channel...28`
• `Time` -> `Time...29`
• `TrackID` -> `TrackID...30`
• `ID` -> `ID...31`
• `X` -> `X...32`
• `Unit` -> `Unit...34`
• `Channel` -> `Channel...35`
• `Time` -> `Time...36`
• `TrackID` -> `TrackID...37`
• `ID` -> `ID...38`
• `X` -> `X...39`
• `Unit` -> `Unit...41`
• `Channel` -> `Channel...42`
• `Time` -> `Time...43`
• `TrackID` -> `TrackID...44`
• `ID` -> `ID...45`
• `X` -> `X...46`
• `Unit` -> `Unit...48`
• `Time` -> `Time...49`
• `TrackID` -> `TrackID...50`
• `ID` -> `ID...51`
• `X` -> `X...52`
• `Unit` -> `Unit...54`
• `Time` -> `Time...55`
• `TrackID` -> `TrackID...56`
• `ID` -> `ID...57`
• `X` -> `X...58`
• `Unit` -> `Unit...60`
• `Time` -> `Time...61`
• `TrackID` -> `TrackID...62`
• `ID` -> `ID...63`
• `X` -> `X...64`
• `Unit` -> `Unit...66`
• `Time` -> `Time...67`
• `TrackID` -> `TrackID...68`
• `ID` -> `ID...69`
• `X` -> `X...70`
• `Unit` -> `Unit...74`
• `Time` -> `Time...76`
• `TrackID` -> `TrackID...77`
• `ID` -> `ID...78`
• `X` -> `X...79`
Warning: Problem while computing `experiment = ...[]`.
ℹ argument is not an atomic vector; coercing
Warning: Problem while computing `sample = ...[]`.
ℹ argument is not an atomic vector; coercing
Warning in stri_split_regex(string, pattern, n = n, simplify = simplify,  :
  argument is not an atomic vector; coercing
New names:
• `Unit` -> `Unit...2`
• `Time` -> `Time...3`
• `TrackID` -> `TrackID...4`
• `ID` -> `ID...5`
• `X` -> `X...6`
• `Unit` -> `Unit...8`
• `Time` -> `Time...9`
• `TrackID` -> `TrackID...10`
• `ID` -> `ID...11`
• `X` -> `X...12`
• `Unit` -> `Unit...14`
• `Time` -> `Time...15`
• `TrackID` -> `TrackID...16`
• `ID` -> `ID...17`
• `X` -> `X...18`
• `Unit` -> `Unit...20`
• `Channel` -> `Channel...21`
• `Time` -> `Time...22`
• `TrackID` -> `TrackID...23`
• `ID` -> `ID...24`
• `X` -> `X...25`
• `Unit` -> `Unit...27`
• `Channel` -> `Channel...28`
• `Time` -> `Time...29`
• `TrackID` -> `TrackID...30`
• `ID` -> `ID...31`
• `X` -> `X...32`
• `Unit` -> `Unit...34`
• `Channel` -> `Channel...35`
• `Time` -> `Time...36`
• `TrackID` -> `TrackID...37`
• `ID` -> `ID...38`
• `X` -> `X...39`
• `Unit` -> `Unit...41`
• `Channel` -> `Channel...42`
• `Time` -> `Time...43`
• `TrackID` -> `TrackID...44`
• `ID` -> `ID...45`
• `X` -> `X...46`
• `Unit` -> `Unit...48`
• `Time` -> `Time...49`
• `TrackID` -> `TrackID...50`
• `ID` -> `ID...51`
• `X` -> `X...52`
• `Unit` -> `Unit...54`
• `Time` -> `Time...55`
• `TrackID` -> `TrackID...56`
• `ID` -> `ID...57`
• `X` -> `X...58`
• `Unit` -> `Unit...60`
• `Time` -> `Time...61`
• `TrackID` -> `TrackID...62`
• `ID` -> `ID...63`
• `X` -> `X...64`
• `Unit` -> `Unit...66`
• `Time` -> `Time...67`
• `TrackID` -> `TrackID...68`
• `ID` -> `ID...69`
• `X` -> `X...70`
• `Unit` -> `Unit...74`
• `Time` -> `Time...76`
• `TrackID` -> `TrackID...77`
• `ID` -> `ID...78`
• `X` -> `X...79`
Warning: Problem while computing `experiment = ...[]`.
ℹ argument is not an atomic vector; coercing
Warning: Problem while computing `sample = ...[]`.
ℹ argument is not an atomic vector; coercing
New names:
• `Time...3` -> `Time`
• `TrackID...4` -> `TrackID`
New names:
• `Time...3` -> `Time`
• `TrackID...4` -> `TrackID`
New names:
• `Time...3` -> `Time`
• `TrackID...4` -> `TrackID`
New names:
• `Time...3` -> `Time`
• `TrackID...4` -> `TrackID`
New names:
• `Time...3` -> `Time`
• `TrackID...4` -> `TrackID`
New names:
• `Time...3` -> `Time`
• `TrackID...4` -> `TrackID`
New names:
• `Time...3` -> `Time`
• `TrackID...4` -> `TrackID`
New names:
• `Time...3` -> `Time`
• `TrackID...4` -> `TrackID`
list.of.files.gfp$`20min` %>% 
  split(.$field)
$s1

$s2

$s3

$s4

$s5

$s6

$s7

$s8
NA

#Assigning the sample by to each field. There are two fields of autofluorescecne in this experiment. The neg.singal stands for the autofluorescence sample.

list.of.files.gfp[["20min"]] <- list.of.files.gfp[["20min"]] %>% 
  mutate(sample = ifelse(exp.field %in% c("20min_s1", "20min_s2"), "neg.signal", "pos.signal"))

#getting the imaris info of DAPI and pup1-rfp ##files to read (these will have rfp and dapi) ##Use the cells_surface data from Imaris #files to read

#reading the cell surface imaris files

# dapi_pup1_imaris_cells <- dir("~/Imaris-data/2022/proteasome_inhibition/2-23-22-PI/1uM/imaris/surface/cells", full.names = TRUE) 
# 
# list.of.files.dapi.pup1 <- get.imaris.info.dapi_pup1(dir.names = dapi_pup1_imaris_cells, 
#                                                      files_to_read = FilesToReadDAPIRFP)
# 
# unique(list.of.files.dapi.pup1$timepoint)

#getting the pup1-rfp puncta info ##use the pup1_surface info from Imaris

FilesToReadDAPIRFP <- c("C0_Area", 
            "C0_BoundingBoxOO_Length_B",
            "C0_BoundingBoxOO_Length_C",
            "C0_Ellipsoid_Axis_Length_B",
            "C0_Ellipsoid_Axis_Length_C",
            "C0_Intensity_Center_Ch=4",
            "C0_Intensity_Mean_Ch=4", 
            "C0_Intensity_Median_Ch=4",
            "C0_Intensity_Sum_Ch=4",
            "C0_Intensity_Center_Ch=5",
            "C0_Intensity_Mean_Ch=5", 
            "C0_Intensity_Median_Ch=5",
            "C0_Intensity_Sum_Ch=5",
            "C0_Number_of_Voxels", 
            "C0_Number_of_Triangles",
            "C0_Sphericity", 
            "C0_Volume.csv", 
            "C0_Position_X.csv",
            "C0_Position_Y.csv",
            "C0_Intensity_Max_Ch=6",
            "C0_Intensity_Center_Ch=6")

#first get the info of the cell surface then match each cell surface with the pup1 puncta. do not include the MRG cells as they have no pup1-rfp puncta mask


list.of.files.dapi.pup1 <- list.of.files.dapi.pup1 %>%
    mutate(timepoint = ifelse(timepoint == 2,31,timepoint))
list.of.files.dapi.pup1 %>% split(.$timepoint)
$`1`

$`31`
NA

#Getting the pup1 puncta surface info

pup1_puncta %>% split(.$timepoint)
$`1`

$`31`
NA

#combine the cell surface info with the pup1 puncta info.

#this should have 11159 no. of cells 
pup1.dapi.cell.puncta <- list.of.files.dapi.pup1 %>% #df with entire cell segmented 
  select(
    area,
    pos.x,
    pos.y,
    timepoint,
    all.mask.int.max,
    all.mask.int.center,
    rfp.int.mean,
    rfp.int.median,
    rfp.int.sum,
    dapi.int.mean,
    dapi.int.median,
    dapi.int.sum,
    experiment,
    field
  ) %>% 
  left_join(
    .,
    pup1_puncta %>%        #df with the pup1 puncta segmented 
      select(
        rfp.int.center,
        rfp.int.mean,
        rfp.int.median,
        rfp.int.sum,
        dapi.int.mean,
        dapi.int.sum,
        dapi.int.median,
        all.mask.int.max,
        all.mask.int.center,
        area,
        timepoint,
        experiment,
        field,
        no.of.voxels
      ) %>% rename("area.puncta" = "area",
                   "rfp.center.puncta" = "rfp.int.center",
                   "rfp.mean.puncta" = "rfp.int.mean",
                   "rfp.sum.puncta" = "rfp.int.sum",
                   "rfp.median.puncta" = "rfp.int.median",
                   "dapi.mean.puncta" = "dapi.int.mean",
                   "dapi.sum.puncta" = "dapi.int.sum",
                   "dapi.median.puncta" = "dapi.int.median",
                   "no.of.voxels.puncta" = "no.of.voxels"),
     by = c("all.mask.int.max" , 
            "experiment" , 
            "field" , 
            "timepoint" , 
            "all.mask.int.center")
  )


  
#this has 6514 cells. some cells have multiple puncta. maybe just drop the cells. 

#combine the cell surface + pup1 puncta info of the pup1 expressing cells with all the cell surface information. There will be NAs in the columns with puncta in their names for the neg cells

# pup1.dapi.all <- list.of.files.dapi.pup1 %>% 
#   left_join(.,pup1.dapi.cell.puncta %>% 
#               select(.,area, 
#                      pos.x, 
#                      pos.y,
#                      timepoint,
#                      experiment, 
#                      field, 
#                      rfp.center.puncta, rfp.mean.puncta, rfp.median.puncta, rfp.sum.puncta,
#                      dapi.mean.puncta,dapi.sum.puncta, dapi.median.puncta,
#                      area.puncta, no.of.voxels.puncta), 
#             by = c("area","pos.x","pos.y","timepoint", "experiment", "field"))
# 
# pup1.dapi.all

#dont need to do this. 

Combining the GFP intensities with the rfp puncta info at t = 1

cell_atributes <- list.of.files.gfp$`20min` %>% 
  filter(timepoint %in% c(1,32)) %>% 
  left_join(.,pup1.dapi.cell.puncta %>% select(-all.mask.int.max,
                                               -all.mask.int.center) ,
            by = c("area",
                   "timepoint",
                   "pos.x",
                   "pos.y",
                   "experiment",
                   "field"))

cell_atributes %>% 
  # filter(unique.trackID == "1000001774_20min_s3")
    dplyr::group_by(field, unique.trackID, timepoint) %>%
    dplyr::summarise(n = dplyr::n(), .groups = "drop") %>%
    dplyr::filter(n > 1L)
#6440 cells. There are 6 cells with multiple pup1 puncta. maybe drop these cells just for simplicity purposes. 

#Background subtraction

#background info files for gfp and mcherry and DAPI: the background folder has two directories: gfp bg and mcherry+dapi bg
bg <- dir(path = "~/Imaris-data/2022/pup1_rfp/10-7-22/cln2/background" , full.names = TRUE)

#Get the information for the background intensity for every image for 
#rfp and DAPI
rfp.dapi.bg.means <- bg.intensity.rfp.dapi(bg.files = list.files(bg[1] , full.names = TRUE))
rfp.dapi.bg.means
$`20min`
#for GFP
gfp.bg.mean <- bg.intensity.gfp(bg.files = list.files(bg[2] , full.names = TRUE))

gfp.bg.mean$`20min` %>% arrange(field,timepoint)

#gfp background for s1 and s2 samples:

s1.2gfp.bg_files <- list.files("~/Imaris-data/2022/pup1_rfp/10-7-22/cln2/background/bg_gfp_s1_s2", full.names = T)

gfp.bg.mean.s1.2<- lapply(s1.2gfp.bg_files, function(a){
  read.csv(a) %>% 
  mutate(field = str_split(Label, "_", simplify = T)[,ncol(str_split(Label, "_", simplify = T))-2],
         timepoint = as.numeric(str_remove(str_split(Label, "_", simplify = T)[,ncol(str_split(Label, "_", simplify = T))-1], "t"))) %>% 
  select(field,
         timepoint,
         Mean,
         Min) %>% 
  group_by(timepoint, field) %>% 
  summarise(avg.gfp.bg = mean(Mean))
}) %>% bind_rows()
`summarise()` has grouped output by 'timepoint'. You can override using the `.groups` argument.
`summarise()` has grouped output by 'timepoint'. You can override using the `.groups` argument.
`summarise()` has grouped output by 'timepoint'. You can override using the `.groups` argument.
gfp.bg.mean$`20min` <- gfp.bg.mean$`20min` %>% 
  left_join(.,gfp.bg.mean.s1.2, by = c("field", "timepoint")) %>% 
  mutate(avg.gfp.bg = ifelse(is.na(avg.gfp.bg), Mean_gfp, avg.gfp.bg)) 

gfp.bg.mean$`20min` %>% 
  group_by(field) %>% 
  arrange(field, timepoint)
s1.2rfp.dapi <- list.files("~/Imaris-data/2022/pup1_rfp/10-7-22/cln2/background/bg_mcherry_dapi_s1_s2", full.names = T)

rfp.bg.mean.s1.2 <- lapply(s1.2rfp.dapi, function(a){
  read.csv(a) %>%
  mutate(field = str_split(Label, "_", simplify = T)[,ncol(str_split(Label, "_", simplify = T))-2],
         timepoint = as.numeric(str_remove(str_split(Label, "_", simplify = T)[,ncol(str_split(Label, "_", simplify = T))-1], "t")),
          channel = str_split(Label, "_", simplify = T)[,ncol(str_split(Label, "_", simplify = T))]) %>%
  mutate(channel = ifelse(channel == "C4", "Dapi", "mcherry")) %>%
  select(field,
         timepoint,
         channel,
         Mean,
         Min) %>%
  group_by(timepoint, field, channel) %>%
  summarise(avg.gfp.bg = mean(Mean)) %>%
  pivot_wider(names_from = channel,
              values_from = avg.gfp.bg)
}) %>% bind_rows()
`summarise()` has grouped output by 'timepoint', 'field'. You can override using the `.groups` argument.
`summarise()` has grouped output by 'timepoint', 'field'. You can override using the `.groups` argument.
`summarise()` has grouped output by 'timepoint', 'field'. You can override using the `.groups` argument.
rfp.dapi.bg.means$`20min` <- rfp.dapi.bg.means$`20min` %>%
  left_join(.,rfp.bg.mean.s1.2, by = c("field", "timepoint")) %>%
  mutate(Dapi = ifelse(is.na(Dapi), avg.dapi.bg, Dapi),
         mcherry = ifelse(is.na(mcherry), avg.rfp.bg, mcherry)) %>%
  select(-avg.dapi.bg,
         -avg.rfp.bg) %>%
  rename("avg.dapi.bg" = "Dapi",
         "avg.rfp.bg" = "mcherry")

#actually subtract the background intensity from the gfp and mcherry intensity of the cells

#first fun. sub.bg.intensity subtracts the bg intensity from each cell. 

gfp.bg.sub <- sub.bg.intensity.gfp(list.of.files = list.of.files.gfp, 
                                   bg.means = gfp.bg.mean$`20min`)
gfp.bg.sub
$`20min`
rfp.dapi.bg.sub <- sub.bg.intensity.dapi.rfp(list.of.files = cell_atributes, 
                                             bg.means = rfp.dapi.bg.means$`20min` )

gfp.bg.sub$`20min` %>% 
  filter(gfp.mean.bg.sub > 0,
         ) %>% 
  group_by(field, timepoint) %>% 
  tally() 

rfp.dapi.bg.sub$`20min` %>% split(.$field)
$s1

$s2

$s3

$s4

$s5

$s6

$s7

$s8
NA

#combine the background subtracted gfp dataframe with the bg subtracted rfp/dapi total and puncta dfs

gfp.rfp.dapi.bg.sub <- gfp.bg.sub$`20min` %>% 
  filter(timepoint %in% c(1,32)) %>% 
  select(unique.trackID,
         gfp.mean.bg.sub,
         gfp.sum.bg.sub,
         avg.gfp.bg,
         area,
         pos.x,
         pos.y) %>% 
  left_join(.,rfp.dapi.bg.sub$`20min`, by = c("unique.trackID", "area","pos.x","pos.y")) %>% split(.$experiment)

#filtering cells which have negative background subtracted intensities

#Uniqe trackIDs of cells above the background int for gfp, dapi and rfp 
#this function results in a list of two dfs. the 1st df = uniquetrackIDs with the experiment they're from.
listOfUniqtrackID_gfpfiltereddf <- trackID.abv.zero.gfp.rfp.dapi(
  bg_subtracted_dftp1 = gfp.rfp.dapi.bg.sub,
  list_gfp_all_tps = gfp.bg.sub)
#the df with gfp intensities for all timepoints which is filtered for cells gfp.mean.bg.sub > 0 
list.of.files.bg.sub.above.0.gfp <- listOfUniqtrackID_gfpfiltereddf[[2]] %>% 
  split(.$experiment)

#removing cells with negative background subtracted intensities from the dataframe with the cell info from timepoint 1 and the last timepoint

gfp_rfp_dapi_bgsubAbvZero_tp1 <- listOfUniqtrackID_gfpfiltereddf[[1]] %>% 
  left_join(.,bind_rows(gfp.rfp.dapi.bg.sub) , by = c("unique.trackID", "experiment"))

gfp_rfp_dapi_bgsubAbvZero_tp1 %>% 
  group_by(timepoint, exp.field) %>% 
  tally()

list.of.files.bg.sub.above.0.gfp$`20min`%>% 
  group_by(timepoint, exp.field) %>% tally()

#density plot of the DAPI staining. Higher DAPI staining == dead cells

#at the first timepoint
gfp_rfp_dapi_bgsubAbvZero_tp1  %>% 
  ggplot(.,aes(x = dapi.mean.bg.sub, color = as.factor(timepoint)))+
  geom_density(aes(y=..scaled..))+
  facet_wrap(~field, scales = "free_x")+
  scale_x_log10()+
  theme_pubr(x.text.angle = 45)
Warning in self$trans$transform(x) : NaNs produced
Warning: Transformation introduced infinite values in continuous x-axis
Warning: Removed 56 rows containing non-finite values (stat_density).

#correlation of the dapi staining at timepint 1 and the last timepoint
# gfp_rfp_dapi_bgsubAbvZero_tp1  %>%
#   select(dapi.mean.bg.sub, timepoint, field, unique.trackID) %>%
#   filter(!(unique.trackID == "1000000259_20min_s8")) %>% 
#   pivot_wider(values_from = dapi.mean.bg.sub, names_from = timepoint) %>% 
#   ggplot(.,aes(x = `1`, y = `31`))+
#   geom_point()+
#   facet_wrap(~field, scales = "free_x")+
#   theme_pubr(x.text.angle = 45)

#the above code did not work because there are duplicate values for a given cell ID. 

#to find the duplicates
gfp_rfp_dapi_bgsubAbvZero_tp1  %>% 
  select(dapi.mean.bg.sub, timepoint, field, unique.trackID) %>%
    dplyr::group_by(field, unique.trackID, timepoint) %>%
    dplyr::summarise(n = dplyr::n(), .groups = "drop") %>%
    dplyr::filter(n > 1L)

#remove the duplicates and look at how dapi staining is changing from timepoint 1 to tp 31:
#correlation of the dapi staining at timepint 1 and the last timepoint
# gfp_rfp_dapi_bgsubAbvZero_tp1  %>%
#   select(dapi.mean.bg.sub, timepoint, field, unique.trackID) %>%
#   filter(!(unique.trackID == "1000002071_20min_s8")) %>% 
#   pivot_wider(values_from = dapi.mean.bg.sub, names_from = timepoint) %>% 
#   ggplot(.,aes(x = `1`, y = `31`))+
#   geom_point()+
#   facet_wrap(~field, scales = "free_x")+
#   theme_pubr(x.text.angle = 45)

#get the threshold of dapi above which the cells will be deemed dead!!

#split the df into the experiments so that there is a dead cell threshold for every experiment 
deadcell_temp_df <- gfp_rfp_dapi_bgsubAbvZero_tp1 %>% 
  split(.$experiment) 


deadCell_boundry <- dapi.threshold(df_for_threshold = deadcell_temp_df , lower_lim = 100, uppr_lim = 300 ) %>% 
  rename("exp.field" = "experiment")
Warning in self$trans$transform(x) : NaNs produced
Warning: Transformation introduced infinite values in continuous x-axis
Warning: Removed 1 rows containing non-finite values (stat_density).
Warning in self$trans$transform(x) : NaNs produced
Warning: Transformation introduced infinite values in continuous x-axis
Warning: Removed 52 rows containing non-finite values (stat_density).
Warning in self$trans$transform(x) : NaNs produced
Warning: Transformation introduced infinite values in continuous x-axis
Warning: Removed 3 rows containing non-finite values (stat_density).
#at the first timepoint
gfp_rfp_dapi_bgsubAbvZero_tp1 %>% 
  filter(timepoint == 1) %>% 
  left_join(.,deadCell_boundry , by = "exp.field") %>% 
  ggplot(.,aes(x = dapi.mean.bg.sub, color = sample))+
  geom_density(aes(y=..scaled..))+
  geom_vline(data= deadCell_boundry, aes(xintercept = dapi.threshold))+
  facet_wrap(~exp.field, scales = "free_x")+
  scale_x_log10()+
  annotation_logticks()+
  theme_pubr(x.text.angle = 45)
Warning in self$trans$transform(x) : NaNs produced
Warning: Transformation introduced infinite values in continuous x-axis
Warning: Removed 56 rows containing non-finite values (stat_density).

#removing cells with dapi intensity greater than the dapi threshold set

#getting the IDs of the cells remaining after removing the cells with higher than threshold dapi intensity. use this to filter cells from the df with mcherry and gfp timelapse information
#will remove dead cells from the first timepoint 
dapi.filtered.cellsTrackID <- bind_rows(deadcell_temp_df) %>% 
  filter(timepoint %in% c(1,32)) %>% 
  left_join(.,deadCell_boundry, by = "exp.field") %>% 
  filter(dapi.mean.bg.sub < dapi.threshold) %>% pull(unique.trackID)

#df with fluorescent intensities of gfp, rfp and dapi for live cells at tp =1 ant tp = 31.
liveCellsRFP.DAPI.GFP <- gfp_rfp_dapi_bgsubAbvZero_tp1 %>% 
  left_join(.,deadCell_boundry, by = "exp.field") %>% 
  filter(dapi.mean.bg.sub < dapi.threshold)


#df with dead cells removed this df has gfp intensities for all the timepoint which are filtered for dead cells 
new.gfpLiveCells <-  bind_rows(list.of.files.bg.sub.above.0.gfp) %>% 
  filter(unique.trackID %in% liveCellsRFP.DAPI.GFP$unique.trackID)

#saving the dataframe with the background subtracted, dead cells filtered intensities of gfps from the autofluor cells (MRG) and the gfp positive cells.

new.gfpLiveCells %>% 
  write_csv(.,path = "~/plots/pup1-rfp-gfp-decay/10-7-22-cln2-gfp/data/raw_gfp_int_all.csv")
Warning: The `path` argument of `write_csv()` is deprecated as of readr 1.4.0.
Please use the `file` argument instead.
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.

looking at the distribution of rfp and gfp in the live cells

#autofluresence of pup1-rfp
liveCellsRFP.DAPI.GFP %>% 
  filter(timepoint == 1) %>% 
  ggplot(.,aes(x =rfp.mean.bg.sub , color = sample) )+
  geom_density(aes(y = ..scaled..))+
  scale_x_log10()+ 
  facet_wrap(~experiment)+
  annotation_logticks()


liveCellsRFP.DAPI.GFP %>% 
  filter(timepoint == 1) %>% 
  filter(sample == "pos.signal") %>% 
  ggplot(.,aes(x =rfp.mean.bg.sub.puncta , y = gfp.mean.bg.sub) )+
  geom_point()+
  geom_smooth(method = "lm")+
  scale_x_log10()+ 
  scale_y_log10()
`geom_smooth()` using formula 'y ~ x'
Warning: Removed 357 rows containing non-finite values (stat_smooth).
Warning: Removed 357 rows containing missing values (geom_point).

#autofluorescence vs gfp signal 
liveCellsRFP.DAPI.GFP %>% 
  filter(timepoint == 1) %>% 
  ggplot(.,aes(x = gfp.mean.bg.sub, color = sample))+
  geom_density(aes(y = ..scaled..))+
  scale_x_log10()+
  facet_wrap(~field, scales = "free_x")

#plotting line plots raw without any AF filtering

Fix background for s1 and s2: fixed background intensities of s1, s3, 4 till s8.

#Filtering cells based on autofluorescence

##getting the autofluorescence threshold for gfp and mcherry

bind_rows(new.gfpLiveCells) %>% 
  filter(experiment == "20min") %>% 
  ggplot(.,aes(x = gfp.mean.bg.sub, color = sample))+
  geom_density(aes(y = ..scaled..))+
  facet_wrap(~timepoint , scales = "free_x")+
  scale_x_log10()
Warning in self$trans$transform(x) : NaNs produced
Warning: Transformation introduced infinite values in continuous x-axis
Warning: Removed 611 rows containing non-finite values (stat_density).

#filtering based on pup1-rfp expression ##filtering cells which are above the gfp and rfp threshold In the filter.cells.below.autofluor.31tp.gfpV2() function, the function looks for the column named “threshold” and I need to decide which column will be threshold based on the overlap of the neg and positive cells. This is because there are cells which become dead/become in focus as you keep taking images which might suddenly increase the 95th quantile intensity of the negative cells.

#get a filtered df of cells passing the gfp threshold set above 
#this function below first removes cells with pup1-rfp less than the threshold set. 
#Then it removes the cells with less than AF threshold set at tp =1 
#After that it subtracts the af value from every cell for every timepoint, and if the subtracted value is less than 1 it makes it NA. 

cells.filtered.df.31tp <- filter.cells.below.autofluor.31tp.gfpV2(
  df_rfp_dapi_gfp = liveCellsRFP.DAPI.GFP,
  
  rfp_min_int = rfp.min.int %>% rename("quant_95" = "threshold_95", 
                                       "threshold_95" = "pup1_threshold"),
  
  gfp_live_cells_list = new.gfpLiveCells %>% split(.$experiment),
  
  gfp_min_int = gfp.min.int %>% 
    mutate(threshold = threshold_95 )
)

filtered.df.new.wo.af.31tp <- cells.filtered.df.31tp$filtered.df.new %>% 
  bind_rows() %>% 
  filter(sample == "pos.signal") %>% 
  split(.$experiment)

unique(filtered.df.new.wo.af.31tp$`20min`$timepoint)
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
  

remove the first two blurry images from s7

# filtered.df.new.wo.af.31tp$`20min` <- filtered.df.new.wo.af.31tp$`20min` %>% filter(field == "s7")
#   filter(!(field == "s7" & timepoint %in% c(1,2))) 

#making df for bulk regression

###This function creats the df for fitting the 24 models 
# list.df.model <- df.model(filtered.df.new = filtered.df.new.wo.af)
df.model.31tp.gfp <- df.model.gfp(filtered.df.new = filtered.df.new.wo.af.31tp)
df.model.31tp.gfp

####This function cleans up the df where you subtract the t=0 intensity with all the other intensities for gfp
final.data.31tp.gfp <- clean.df.modeling.gfp(data.gfp = df.model.31tp.gfp)

On 1/28/21 talked to premal about filtering: 1. Remove cells which have positive delta Intensity more than 2 times

#getting IDs of cells which have positive intensity values for less than 2 timepoints 
ids.int.2 <- final.data.31tp.gfp %>% 
  group_by(unique.trackID) %>% 
  tally(ln.gfp.dif > 0) %>% 
  filter(n<2) %>%            #keep cells which have less than two positive intensity values
  pull(unique.trackID)

#filtering cells which have trackID in the above vector  
#gfp
temp.posIntBlw2.gfp <- final.data.31tp.gfp %>% 
  filter(unique.trackID %in% ids.int.2) 

df_for_MechanisticModel <- temp.posIntBlw2.gfp  %>%
  left_join(
    .,
    bind_rows(filtered.df.new.wo.af.31tp) ,
    by = c(
      "unique.trackID",
      "timepoint" ,
      "experiment" ,
      "gfp.mean.bg.af.sub.new" ,
      "exp.field"
    )
  )

#save this dataframe for half life estimation

#saving the data

gfp_cln2Pest_filtered <- df_for_MechanisticModel  %>%
  rename("cell.id" = "unique.trackID",
         "gfpSumBgAFsub" = "gfp.sum.bg.af.sub",
         "gfpMeanBgAFsub"="gfp.mean.bg.af.sub.new",
         "nat.log.GfpMean" = "ln.gfp" , 
         "delta.int" = "ln.gfp.dif",
         "delta.time" = "time"
         ) %>% 
  select( cell.id,
         gfpSumBgAFsub,
         gfpMeanBgAFsub,
         nat.log.GfpMean,
         delta.time,
         image.no,
         delta.int, 
         exp.field
         )

write_csv(gfp_mODCPest_filtered , file = "~/plots/pup1-rfp-gfp-decay/6-28-22-cln2-gfp/data/gfp_cln2Pest_pup1_filtered.csv")
Error in is.data.frame(x) : object 'gfp_mODCPest_filtered' not found

#SAVING THE DATAFRAME WHICH HAS ALL THE BACKGROUND INT, AUTOFLUOR INTENSITY (AT THE INTERSECTION, THE 80TH AND THE 95TH QUANTILE OF MRG AUTO GFP INTENSITY)

write_csv(df_for_MechanisticModel , file = "~/plots/pup1-rfp-gfp-decay/6-28-22-cln2-gfp/data/gfp_cln2Pest_pup1_raw_data.csv")
gfp_cln2Pest_filtered %>% 
  ggplot(.,aes(delta.time, gfpMeanBgAFsub, group = cell.id))+
  geom_line(alpha = 0.2)+
  facet_wrap(~exp.field, scales = "free_y")

LS0tCnRpdGxlOiAiUiBOb3RlYm9vayIKb3V0cHV0OiBodG1sX25vdGVib29rCi0tLQotLS0KdGl0bGU6ICIxMC03LTIyIGNsbjItZ2ZwIHB1cDEtcmZwIGRlY2F5IgpvdXRwdXQ6IGh0bWxfbm90ZWJvb2sKLS0tCgoKT25seSAyMG1pbiB0aW1lbGFwc2UgYmVjYXVzZSB3ZSBjb25jbHVkZWQgdGhhdCB3ZSB3b250IGJlIGFibGUgdG8gZGVjb3VwbGUgcGhvdG9ibGVhY2hpbmcgZnJvbSBwcm90ZWFzb21hbCBkZWNheQoKdGhpcyBSTUQgaXMgdG8gZ2VuZXJhdGUgdGhlIGRmIGZvciBkZWNheSByYXRlIGVzdGltYXRpb24gZm9yIHRoZSBETVNPIGNvbnRyb2wKCmBgYHtyfQpsaWJyYXJ5KGRhdGEudGFibGUpCmxp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gIHBvcy55LAogICAgdGltZXBvaW50LAogICAgYWxsLm1hc2suaW50Lm1heCwKICAgIGFsbC5tYXNrLmludC5jZW50ZXIsCiAgICByZnAuaW50Lm1lYW4sCiAgICByZnAuaW50Lm1lZGlhbiwKICAgIHJmcC5pbnQuc3VtLAogICAgZGFwaS5pbnQubWVhbiwKICAgIGRhcGkuaW50Lm1lZGlhbiwKICAgIGRhcGkuaW50LnN1bSwKICAgIGV4cGVyaW1lbnQsCiAgICBmaWVsZAogICkgJT4lIAogIGxlZnRfam9pbigKICAgIC4sCiAgICBwdXAxX3B1bmN0YSAlPiUgICAgICAgICNkZiB3aXRoIHRoZSBwdXAxIHB1bmN0YSBzZWdtZW50ZWQgCiAgICAgIHNlbGVjdCgKICAgICAgICByZnAuaW50LmNlbnRlciwKICAgICAgICByZnAuaW50Lm1lYW4sCiAgICAgICAgcmZwLmludC5tZWRpYW4sCiAgICAgICAgcmZwLmludC5zdW0sCiAgICAgICAgZGFwaS5pbnQubWVhbiwKICAgICAgICBkYXBpLmludC5zdW0sCiAgICAgICAgZGFwaS5pbnQubWVkaWFuLAogICAgICAgIGFsbC5tYXNrLmludC5tYXgsCiAgICAgICAgYWxsLm1hc2suaW50LmNlbnRlciwKICAgICAgICBhcmVhLAogICAgICAgIHRpbWVwb2ludCwKICAgICAgICBleHBlcmltZW50LAogICAgICAgIGZpZWxkLAogICAgICAgIG5vLm9mLnZveGVscwogICAgICApICU+JSByZW5hbWUoImFyZWEucHVuY3RhIiA9ICJhcmVhIiwKICAgICAgICAgICAgICAgICAgICJyZnAuY2VudGVyLnB1bmN0YSIgPSAicmZwLmludC5jZW50ZXIiLAogICAgICAgICAgICAgICAgICAgInJmcC5tZWFuLnB1bmN0YSIgPSAicmZwLmludC5tZWFuIiwKICAgICAgICAgICAgICAgICAgICJyZnAuc3VtLnB1bmN0YSIgPSAicmZwLmludC5zdW0iLAogICAgICAgICAgICAgICAgICAgInJmcC5tZWRpYW4ucHVuY3RhIiA9ICJyZnAuaW50Lm1lZGlhbiIsCiAgICAgICAgICAgICAgICAgICAiZGFwaS5tZWFuLnB1bmN0YSIgPSAiZGFwaS5pbnQubWVhbiIsCiAgICAgICAgICAgICAgICAgICAiZGFwaS5zdW0ucHVuY3RhIiA9ICJkYXBpLmludC5zdW0iLAogICAgICAgICAgICAgICAgICAgImRhcGkubWVkaWFuLnB1bmN0YSIgPSAiZGFwaS5pbnQubWVkaWFuIiwKICAgICAgICAgICAgICAgICAgICJuby5vZi52b3hlbHMucHVuY3RhIiA9ICJuby5vZi52b3hlbHMiKSwKICAgICBieSA9IGMoImFsbC5tYXNrLmludC5tYXgiICwgCiAgICAgICAgICAgICJleHBlcmltZW50IiAsIAogICAgICAgICAgICAiZmllbGQiICwgCiAgICAgICAgICAgICJ0aW1lcG9pbnQiICwgCiAgICAgICAgICAgICJhbGwubWFzay5pbnQuY2VudGVyIikKICApCgoKICAKI3RoaXMgaGFzIDY1MTQgY2VsbHMuIHNvbWUgY2VsbHMgaGF2ZSBtdWx0aXBsZSBwdW5jdGEuIG1heWJlIGp1c3QgZHJvcCB0aGUgY2VsbHMuIApgYGAKCgojY29tYmluZSB0aGUgY2VsbCBzdXJmYWNlICsgcHVwMSBwdW5jdGEgaW5mbyBvZiB0aGUgcHVwMSBleHByZXNzaW5nIGNlbGxzIHdpdGggYWxsIHRoZSBjZWxsIHN1cmZhY2UgaW5mb3JtYXRpb24uIFRoZXJlIHdpbGwgYmUgTkFzIGluIHRoZSBjb2x1bW5zIHdpdGggcHVuY3RhIGluIHRoZWlyIG5hbWVzIGZvciB0aGUgbmVnIGNlbGxzIApgYGB7cn0KIyBwdXAxLmRhcGkuYWxsIDwtIGxpc3Qub2YuZmlsZXMuZGFwaS5wdXAxICU+JSAKIyAgIGxlZnRfam9pbiguLHB1cDEuZGFwaS5jZWxsLnB1bmN0YSAlPiUgCiMgICAgICAgICAgICAgICBzZWxlY3QoLixhcmVhLCAKIyAgICAgICAgICAgICAgICAgICAgICBwb3MueCwgCiMgICAgICAgICAgICAgICAgICAgICAgcG9zLnksCiMgICAgICAgICAgICAgICAgICAgICAgdGltZXBvaW50LAojICAgICAgICAgICAgICAgICAgICAgIGV4cGVyaW1lbnQsIAojICAgICAgICAgICAgICAgICAgICAgIGZpZWxkLCAKIyAgICAgICAgICAgICAgICAgICAgICByZnAuY2VudGVyLnB1bmN0YSwgcmZwLm1lYW4ucHVuY3RhLCByZnAubWVkaWFuLnB1bmN0YSwgcmZwLnN1bS5wdW5jdGEsCiMgICAgICAgICAgICAgICAgICAgICAgZGFwaS5tZWFuLnB1bmN0YSxkYXBpLnN1bS5wdW5jdGEsIGRhcGkubWVkaWFuLnB1bmN0YSwKIyAgICAgICAgICAgICAgICAgICAgICBhcmVhLnB1bmN0YSwgbm8ub2Yudm94ZWxzLnB1bmN0YSksIAojICAgICAgICAgICAgIGJ5ID0gYygiYXJlYSIsInBvcy54IiwicG9zLnkiLCJ0aW1lcG9pbnQiLCAiZXhwZXJpbWVudCIsICJmaWVsZCIpKQojIAojIHB1cDEuZGFwaS5hbGwKCiNkb250IG5lZWQgdG8gZG8gdGhpcy4gCmBgYAoKCkNvbWJpbmluZyB0aGUgR0ZQIGludGVuc2l0aWVzIHdpdGggdGhlIHJmcCBwdW5jdGEgaW5mbyBhdCB0ID0gMSAKYGBge3J9CmNlbGxfYXRyaWJ1dGVzIDwtIGxpc3Qub2YuZmlsZXMuZ2ZwJGAyMG1pbmAgJT4lIAogIGZpbHRlcih0aW1lcG9pbnQgJWluJSBjKDEsMzIpKSAlPiUgCiAgbGVmdF9qb2luKC4scHVwMS5kYXBpLmNlbGwucHVuY3RhICU+JSBzZWxlY3QoLWFsbC5tYXNrLmludC5tYXgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLWFsbC5tYXNrLmludC5jZW50ZXIpICwKICAgICAgICAgICAgYnkgPSBjKCJhcmVhIiwKICAgICAgICAgICAgICAgICAgICJ0aW1lcG9pbnQiLAogICAgICAgIC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Yuc3ViLm5ldyIgLAogICAgICAiZXhwLmZpZWxkIgogICAgKQogICkKCiNzYXZlIHRoaXMgZGF0YWZyYW1lIGZvciBoYWxmIGxpZmUgZXN0aW1hdGlvbgoKYGBgCgoKCmBgYHtyfQpjZWxsX2F0cmlidXRlc19maW5hbCA8LSBkZl9mb3JfTWVjaGFuaXN0aWNNb2RlbCAlPiUgCiAgZmlsdGVyKHRpbWVwb2ludCA9PSAxKSAgJT4lIAogIGxlZnRfam9pbiguLGxpdmVDZWxsc1JGUC5EQVBJLkdGUCAlPiUgc2VsZWN0KHVuaXF1ZS50cmFja0lELAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVwb2ludCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHAuZmllbGQsZXhwZXJpbWVudCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZnAubWVhbi5iZy5zdWIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmZwLm1lYW4uYmcuc3ViLnB1bmN0YSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXBpLm1lYW4uYmcuc3ViLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhcGkubWVhbi5iZy5zdWIucHVuY3RhLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJmcC5zdW0uYmcuc3ViLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJmcC5zdW0uYmcuc3ViLnB1bmN0YSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXBpLnN1bS5iZy5zdWIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGFwaS5zdW0uYmcuc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